package com.bls.blsdemo.MultiThread;

import android.view.View;
import android.widget.Button;

import com.blankj.utilcode.util.ActivityUtils;
import com.bls.blsdemo.R;
import com.bls.lib.ui.activity.BaseActivity;

public class ThreadActivity extends BaseActivity {

    private Button btnHandlerThread, btnIntentService, btnThreadPool;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_thread;
    }

    @Override
    public void findView() {
        btnHandlerThread = findViewById(R.id.btn_handler_thread);
        btnIntentService = findViewById(R.id.btn_intent_service);
        btnThreadPool = findViewById(R.id.btn_thread_pool);
    }

    @Override
    protected void initMain() {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initListener() {
        setOnClickLisenter(btnHandlerThread, btnIntentService, btnThreadPool);
    }

    @Override
    protected void initData() {

    }

    @Override
    public void onClick(View v) {
        Class clazz = null;
        switch (v.getId()) {
            case R.id.btn_handler_thread:
                clazz = HandlerThreadActivity.class;
                break;
            case R.id.btn_intent_service:
                clazz = IntentServiceActivity.class;
                break;
            case R.id.btn_thread_pool:
                clazz = ThreadPoolActivity.class;
                break;
        }
        ActivityUtils.startActivity(clazz != null ? clazz : HandlerThreadActivity.class);
    }
}
